package com 
{
	import flash.display.Sprite;
	import flash.display.BitmapData;
	import flash.display.Bitmap;
	import flash.display.Loader;
	import flash.events.Event;
	import flash.net.URLRequest;
	
	/**
	 * ...
	 * @author ...
	 */
	public class Building extends Sprite 
	{
		private var _building:Bitmap;
		private var _config:XML;
		public function Building(config:XML)
		{
			_config = config;
			loadImg(_config);
		}
		private function loadImg(config:XML):void
		{
			var imgSrc:String = config.@file;
			var loader:Loader = new Loader();
			loader.load(new URLRequest(imgSrc));
			loader.contentLoaderInfo.addEventListener(Event.COMPLETE,loadSuccess);
		}
		private function loadSuccess(evt:Event):void
		{
			_building = new Bitmap(evt.target.content.bitmapData);
			this.addChild(_building);
			//trace(_building.width,_building.height);
			//trace(imgBmd.width,imgBmd.height);
		}
		
	}

}